home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_xemacs.idb / usr / freeware / lib / xemacs-20.4 / info / xemacs.info-9.z / xemacs.info-9
Encoding:
GNU Info File  |  1998-05-21  |  48.2 KB  |  1,171 lines

  1. This is Info file ../../info/xemacs.info, produced by Makeinfo version
  2. 1.68 from the input file xemacs.texi.
  3.  
  4.    This file documents the XEmacs editor.
  5.  
  6.    Copyright (C) 1985, 1986, 1988 Richard M. Stallman.  Copyright (C)
  7. 1991, 1992, 1993, 1994 Lucid, Inc.  Copyright (C) 1993, 1994 Sun
  8. Microsystems, Inc.  Copyright (C) 1995 Amdahl Corporation.
  9.  
  10.    Permission is granted to make and distribute verbatim copies of this
  11. manual provided the copyright notice and this permission notice are
  12. preserved on all copies.
  13.  
  14.    Permission is granted to copy and distribute modified versions of
  15. this manual under the conditions for verbatim copying, provided also
  16. that the sections entitled "The GNU Manifesto", "Distribution" and "GNU
  17. General Public License" are included exactly as in the original, and
  18. provided that the entire resulting derived work is distributed under the
  19. terms of a permission notice identical to this one.
  20.  
  21.    Permission is granted to copy and distribute translations of this
  22. manual into another language, under the above conditions for modified
  23. versions, except that the sections entitled "The GNU Manifesto",
  24. "Distribution" and "GNU General Public License" may be included in a
  25. translation approved by the author instead of in the original English.
  26.  
  27. 
  28. File: xemacs.info,  Node: Just Spaces,  Prev: Tab Stops,  Up: Indentation
  29.  
  30. Tabs vs. Spaces
  31. ===============
  32.  
  33.    Emacs normally uses both tabs and spaces to indent lines.  If you
  34. prefer, all indentation can be made from spaces only.  To request this,
  35. set `indent-tabs-mode' to `nil'.  This is a per-buffer variable;
  36. altering the variable affects only the current buffer, but there is a
  37. default value which you can change as well.  *Note Locals::.
  38.  
  39.    There are also commands to convert tabs to spaces or vice versa,
  40. always preserving the columns of all non-blank text.  `M-x tabify'
  41. scans the region for sequences of spaces, and converts sequences of at
  42. least three spaces to tabs if that is possible without changing
  43. indentation.  `M-x untabify' changes all tabs in the region to
  44. corresponding numbers of spaces.
  45.  
  46. 
  47. File: xemacs.info,  Node: Text,  Next: Programs,  Prev: Indentation,  Up: Top
  48.  
  49. Commands for Human Languages
  50. ****************************
  51.  
  52.    The term "text" has two widespread meanings in our area of the
  53. computer field.  One is data that is a sequence of characters.  In this
  54. sense of the word any file that you edit with Emacs is text.  The other
  55. meaning is more restrictive: a sequence of characters in a human
  56. language for humans to read (possibly after processing by a text
  57. formatter), as opposed to a program or commands for a program.
  58.  
  59.    Human languages have syntactic and stylistic conventions that editor
  60. commands should support or use to advantage: conventions involving
  61. words, sentences, paragraphs, and capital letters.  This chapter
  62. describes Emacs commands for all these things.  There are also commands
  63. for "filling", or rearranging paragraphs into lines of approximately
  64. equal length.  The commands for moving over and killing words,
  65. sentences, and paragraphs, while intended primarily for editing text,
  66. are also often useful for editing programs.
  67.  
  68.    Emacs has several major modes for editing human language text.  If a
  69. file contains plain text, use Text mode, which customizes Emacs in
  70. small ways for the syntactic conventions of text.  For text which
  71. contains embedded commands for text formatters, Emacs has other major
  72. modes, each for a particular text formatter.  Thus, for input to TeX,
  73. you can use TeX mode; for input to nroff, Nroff mode.
  74.  
  75. * Menu:
  76.  
  77. * Text Mode::   The major modes for editing text files.
  78. * Nroff Mode::  The major mode for editing input to the formatter nroff.
  79. * TeX Mode::    The major modes for editing input to the formatter TeX.
  80. * Outline Mode:: The major mode for editing outlines.
  81. * Words::       Moving over and killing words.
  82. * Sentences::   Moving over and killing sentences.
  83. * Paragraphs::    Moving over paragraphs.
  84. * Pages::    Moving over pages.
  85. * Filling::     Filling or justifying text
  86. * Case::        Changing the case of text
  87.  
  88. 
  89. File: xemacs.info,  Node: Text Mode,  Next: Words,  Prev: Text,  Up: Text
  90.  
  91. Text Mode
  92. =========
  93.  
  94.    You should use Text mode--rather than Fundamental or Lisp mode--to
  95. edit files of text in a human language.  Invoke `M-x text-mode' to
  96. enter Text mode.  In Text mode, <TAB> runs the function
  97. `tab-to-tab-stop', which allows you to use arbitrary tab stops set with
  98. `M-x edit-tab-stops' (*note Tab Stops::.).  Features concerned with
  99. comments in programs are turned off unless they are explicitly invoked.
  100. The syntax table is changed so that periods are not considered part of a
  101. word, while apostrophes, backspaces and underlines are.
  102.  
  103.    A similar variant mode is Indented Text mode, intended for editing
  104. text in which most lines are indented.  This mode defines <TAB> to run
  105. `indent-relative' (*note Indentation::.), and makes Auto Fill indent
  106. the lines it creates.  As a result, a line made by Auto Filling, or by
  107. <LFD>, is normally indented just like the previous line.  Use `M-x
  108. indented-text-mode' to select this mode.
  109.  
  110.    Entering Text mode or Indented Text mode calls the value of the
  111. variable `text-mode-hook' with no arguments, if that value exists and
  112. is not `nil'.  This value is also called when modes related to Text
  113. mode are entered; this includes Nroff mode, TeX mode, Outline mode, and
  114. Mail mode.  Your hook can look at the value of `major-mode' to see
  115. which of these modes is actually being entered.
  116.  
  117.    Two modes similar to Text mode are of use for editing text that is to
  118. be passed through a text formatter before achieving its final readable
  119. form.
  120.  
  121. * Menu:
  122.  
  123. * Nroff Mode::  The major mode for editing input to the formatter nroff.
  124. * TeX Mode::    The major modes for editing input to the formatter TeX.
  125.  
  126.  
  127.   Another similar mode is used for editing outlines.  It allows you
  128. to view the text at various levels of detail.  You can view either
  129. the outline headings alone or both headings and text; you can also
  130. hide some of the headings at lower levels from view to make the high
  131. level structure more visible.
  132.  
  133.  
  134. * Outline Mode:: The major mode for editing outlines.
  135.  
  136. 
  137. File: xemacs.info,  Node: Nroff Mode,  Next: TeX Mode,  Prev: Text Mode,  Up: Text Mode
  138.  
  139. Nroff Mode
  140. ----------
  141.  
  142.    Nroff mode is a mode like Text mode but modified to handle nroff
  143. commands present in the text.  Invoke `M-x nroff-mode' to enter this
  144. mode.  Nroff mode differs from Text mode in only a few ways.  All nroff
  145. command lines are considered paragraph separators, so that filling never
  146. garbles the nroff commands.  Pages are separated by `.bp' commands.
  147. Comments start with backslash-doublequote.  There are also three special
  148. commands that are not available in Text mode:
  149.  
  150. `M-n'
  151.      Move to the beginning of the next line that isn't an nroff command
  152.      (`forward-text-line').  An argument is a repeat count.
  153.  
  154. `M-p'
  155.      Like `M-n' but move up (`backward-text-line').
  156.  
  157. `M-?'
  158.      Prints in the echo area the number of text lines (lines that are
  159.      not nroff commands) in the region (`count-text-lines').
  160.  
  161.    The other feature of Nroff mode is Electric Nroff newline mode.
  162. This is a minor mode that you can turn on or off with `M-x
  163. electric-nroff-mode' (*note Minor Modes::.).  When the mode is on and
  164. you use <RET> to end a line containing an nroff command that opens a
  165. kind of grouping, Emacs automatically inserts the matching nroff
  166. command to close that grouping on the following line.  For example, if
  167. you are at the beginning of a line and type `.(b <RET>', the matching
  168. command `.)b' will be inserted on a new line following point.
  169.  
  170.    Entering Nroff mode calls the value of the variable `text-mode-hook'
  171. with no arguments, if that value exists and is not `nil'; then it does
  172. the same with the variable `nroff-mode-hook'.
  173.  
  174. 
  175. File: xemacs.info,  Node: TeX Mode,  Next: Outline Mode,  Prev: Nroff Mode,  Up: Text Mode
  176.  
  177. TeX Mode
  178. --------
  179.  
  180.    TeX is a powerful text formatter written by Donald Knuth; like GNU
  181. Emacs, it is free.  LaTeX is a simplified input format for TeX,
  182. implemented by TeX macros.  It is part of TeX.
  183.  
  184.    Emacs has a special TeX mode for editing TeX input files.  It
  185. provides facilities for checking the balance of delimiters and for
  186. invoking TeX on all or part of the file.
  187.  
  188.    TeX mode has two variants, Plain TeX mode and LaTeX mode, which are
  189. two distinct major modes that differ only slightly.  These modes are
  190. designed for editing the two different input formats.  The command `M-x
  191. tex-mode' looks at the contents of a buffer to determine whether it
  192. appears to be LaTeX input or not; it then selects the appropriate mode.
  193. If it can't tell which is right (e.g., the buffer is empty), the
  194. variable `tex-default-mode' controls which mode is used.
  195.  
  196.    The commands `M-x plain-tex-mode' and `M-x latex-mode' explicitly
  197. select one of the variants of TeX mode.  Use these commands when `M-x
  198. tex-mode' does not guess right.
  199.  
  200. * Menu:
  201.  
  202. * Editing: TeX Editing.   Special commands for editing in TeX mode.
  203. * Printing: TeX Print.    Commands for printing part of a file with TeX.
  204.  
  205.    TeX for Unix systems can be obtained from the University of
  206. Washington for a distribution fee.
  207.  
  208.    To order a full distribution, send $140.00 for a 1/2 inch 9-track
  209. tape, $165.00 for two 4-track 1/4 inch cartridge tapes (foreign sites
  210. $150.00, for 1/2 inch, $175.00 for 1/4 inch, to cover the extra
  211. postage) payable to the University of Washington to:
  212.  
  213.      The Director
  214.      Northwest Computer Support Group,  DW-10
  215.      University of Washington
  216.      Seattle, Washington 98195
  217.  
  218. Purchase orders are acceptable, but there is an extra charge of $10.00
  219. to pay for processing charges. (The total cost comes to $150 for
  220. domestic sites, $175 for foreign sites).
  221.  
  222.    The normal distribution is a tar tape, blocked 20, 1600 bpi, on an
  223. industry standard 2400 foot half-inch reel.  The physical format for
  224. the 1/4 inch streamer cartridges uses QIC-11, 8000 bpi, 4-track
  225. serpentine recording for the SUN.  Also, SystemV tapes can be written
  226. in cpio format, blocked 5120 bytes, ASCII headers.
  227.  
  228. 
  229. File: xemacs.info,  Node: TeX Editing,  Next: TeX Print,  Prev: TeX Mode,  Up: TeX Mode
  230.  
  231. TeX Editing Commands
  232. ....................
  233.  
  234.    Here are the special commands provided in TeX mode for editing the
  235. text of the file.
  236.  
  237. `"'
  238.      Insert, according to context, either ```' or `"' or `'''
  239.      (`TeX-insert-quote').
  240.  
  241. `<LFD>'
  242.      Insert a paragraph break (two newlines) and check the previous
  243.      paragraph for unbalanced braces or dollar signs (`tex-terminate-
  244.      paragraph').
  245.  
  246. `M-x validate-tex-buffer'
  247.      Check each paragraph in the buffer for unbalanced braces or dollar
  248.      signs.
  249.  
  250. `C-c {'
  251.      Insert `{}' and position point between them (`tex-insert-braces').
  252.  
  253. `C-c }'
  254.      Move forward past the next unmatched close brace (`up-list').
  255.  
  256. `C-c C-e'
  257.      Close a block for LaTeX (`tex-close-latex-block').
  258.  
  259.    In TeX, the character `"' is not normally used; you use ```' to
  260. start a quotation and `''' to end one.  TeX mode defines the key `"' to
  261. insert ```' after whitespace or an open brace, `"' after a backslash,
  262. or `''' otherwise.  This is done by the command `tex-insert-quote'.  If
  263. you need the character `"' itself in unusual contexts, use `C-q' to
  264. insert it.  Also, `"' with a numeric argument always inserts that
  265. number of `"' characters.
  266.  
  267.    In TeX mode, `$' has a special syntax code which attempts to
  268. understand the way TeX math mode delimiters match.  When you insert a
  269. `$' that is meant to exit math mode, the position of the matching `$'
  270. that entered math mode is displayed for a second.  This is the same
  271. feature that displays the open brace that matches a close brace that is
  272. inserted.  However, there is no way to tell whether a `$' enters math
  273. mode or leaves it; so when you insert a `$' that enters math mode, the
  274. previous `$' position is shown as if it were a match, even though they
  275. are actually unrelated.
  276.  
  277.    If you prefer to keep braces balanced at all times, you can use `C-c
  278. {' (`tex-insert-braces') to insert a pair of braces.  It leaves point
  279. between the two braces so you can insert the text that belongs inside.
  280. Afterward, use the command `C-c }' (`up-list') to move forward past the
  281. close brace.
  282.  
  283.    There are two commands for checking the matching of braces.  <LFD>
  284. (`tex-terminate-paragraph') checks the paragraph before point, and
  285. inserts two newlines to start a new paragraph.  It prints a message in
  286. the echo area if any mismatch is found.  `M-x validate-tex-buffer'
  287. checks the entire buffer, paragraph by paragraph.  When it finds a
  288. paragraph that contains a mismatch, it displays point at the beginning
  289. of the paragraph for a few seconds and pushes a mark at that spot.
  290. Scanning continues until the whole buffer has been checked or until you
  291. type another key.  The positions of the last several paragraphs with
  292. mismatches can be found in the mark ring (*note Mark Ring::.).
  293.  
  294.    Note that square brackets and parentheses, not just braces, are
  295. matched in TeX mode.  This is wrong if you want to  check TeX syntax.
  296. However, parentheses and square brackets are likely to be used in text
  297. as matching delimiters and it is useful for the various motion commands
  298. and automatic match display to work with them.
  299.  
  300.    In LaTeX input, `\begin' and `\end' commands must balance.  After
  301. you insert a `\begin', use `C-c C-f' (`tex-close-latex-block') to
  302. insert automatically a matching `\end' (on a new line following the
  303. `\begin').  A blank line is inserted between the two, and point is left
  304. there.
  305.  
  306. 
  307. File: xemacs.info,  Node: TeX Print,  Prev: TeX Editing,  Up: TeX Mode
  308.  
  309. TeX Printing Commands
  310. .....................
  311.  
  312.    You can invoke TeX as an inferior of Emacs on either the entire
  313. contents of the buffer or just a region at a time.  Running TeX in this
  314. way on just one chapter is a good way to see what your changes look
  315. like without taking the time to format the entire file.
  316.  
  317. `C-c C-r'
  318.      Invoke TeX on the current region, plus the buffer's header
  319.      (`tex-region').
  320.  
  321. `C-c C-b'
  322.      Invoke TeX on the entire current buffer (`tex-buffer').
  323.  
  324. `C-c C-l'
  325.      Recenter the window showing output from the inferior TeX so that
  326.      the last line can be seen (`tex-recenter-output-buffer').
  327.  
  328. `C-c C-k'
  329.      Kill the inferior TeX (`tex-kill-job').
  330.  
  331. `C-c C-p'
  332.      Print the output from the last `C-c C-r' or `C-c C-b' command
  333.      (`tex-print').
  334.  
  335. `C-c C-q'
  336.      Show the printer queue (`tex-show-print-queue').
  337.  
  338.    You can pass the current buffer through an inferior TeX using `C-c
  339. C-b' (`tex-buffer').  The formatted output appears in a file in `/tmp';
  340. to print it, type `C-c C-p' (`tex-print').  Afterward use `C-c C-q'
  341. (`tex-show-print-queue') to view the progress of your output towards
  342. being printed.
  343.  
  344.    The console output from TeX, including any error messages, appears
  345. in a buffer called `*TeX-shell*'.  If TeX gets an error, you can switch
  346. to this buffer and feed it input (this works as in Shell mode; *note
  347. Interactive Shell::.).  Without switching to this buffer, you can scroll
  348. it so that its last line is visible by typing `C-c C-l'.
  349.  
  350.    Type `C-c C-k' (`tex-kill-job') to kill the TeX process if you see
  351. that its output is no longer useful.  Using `C-c C-b' or `C-c C-r' also
  352. kills any TeX process still running.
  353.  
  354.    You can pass an arbitrary region through an inferior TeX by typing
  355. `C-c C-r' (`tex-region').  This is tricky, however, because most files
  356. of TeX input contain commands at the beginning to set parameters and
  357. define macros.  Without them, no later part of the file will format
  358. correctly.  To solve this problem, `C-c C-r' allows you to designate a
  359. part of the file as containing essential commands; it is included
  360. before the specified region as part of the input to TeX.  The
  361. designated part of the file is called the "header".
  362.  
  363.    To indicate the bounds of the header in Plain TeX mode, insert two
  364. special strings in the file: `%**start of header' before the header,
  365. and `%**end of header' after it.  Each string must appear entirely on
  366. one line, but there may be other text on the line before or after.  The
  367. lines containing the two strings are included in the header.  If
  368. `%**start of header' does not appear within the first 100 lines of the
  369. buffer, `C-c C-r' assumes there is no header.
  370.  
  371.    In LaTeX mode, the header begins with `\documentstyle' and ends with
  372. `\begin{document}'.  These are commands that LaTeX requires you to use,
  373. so you don't need to do anything special to identify the header.
  374.  
  375.    When you enter either kind of TeX mode, Emacs calls with no
  376. arguments the value of the variable `text-mode-hook', if that value
  377. exists and is not `nil'.  Emacs then calls the variable `TeX-mode-hook'
  378. and either `plain-TeX-mode-hook' or `LaTeX-mode-hook' under the same
  379. conditions.
  380.  
  381. 
  382. File: xemacs.info,  Node: Outline Mode,  Prev: TeX Mode,  Up: Text Mode
  383.  
  384. Outline Mode
  385. ------------
  386.  
  387.    Outline mode is a major mode similar to Text mode but intended for
  388. editing outlines.  It allows you to make parts of the text temporarily
  389. invisible so that you can see just the overall structure of the
  390. outline.  Type `M-x outline-mode' to turn on Outline mode in the
  391. current buffer.
  392.  
  393.    When you enter Outline mode, Emacs calls with no arguments the value
  394. of the variable `text-mode-hook', if that value exists and is not
  395. `nil'; then it does the same with the variable `outline-mode-hook'.
  396.  
  397.    When a line is invisible in outline mode, it does not appear on the
  398. screen.  The screen appears exactly as if the invisible line were
  399. deleted, except that an ellipsis (three periods in a row) appears at
  400. the end of the previous visible line (only one ellipsis no matter how
  401. many invisible lines follow).
  402.  
  403.    All editing commands treat the text of the invisible line as part of
  404. the previous visible line.  For example, `C-n' moves onto the next
  405. visible line.  Killing an entire visible line, including its
  406. terminating newline, really kills all the following invisible lines as
  407. well; yanking everything back yanks the invisible lines and they remain
  408. invisible.
  409.  
  410. * Menu:
  411.  
  412. * Format: Outline Format.      What the text of an outline looks like.
  413. * Motion: Outline Motion.      Special commands for moving through outlines.
  414. * Visibility: Outline Visibility. Commands to control what is visible.
  415.  
  416. 
  417. File: xemacs.info,  Node: Outline Format,  Next: Outline Motion,  Prev: Outline Mode,  Up: Outline Mode
  418.  
  419. Format of Outlines
  420. ..................
  421.  
  422.    Outline mode assumes that the lines in the buffer are of two types:
  423. "heading lines" and "body lines".  A heading line represents a topic in
  424. the outline.  Heading lines start with one or more stars; the number of
  425. stars determines the depth of the heading in the outline structure.
  426. Thus, a heading line with one star is a major topic; all the heading
  427. lines with two stars between it and the next one-star heading are its
  428. subtopics; and so on.  Any line that is not a heading line is a body
  429. line.  Body lines belong to the preceding heading line.  Here is an
  430. example:
  431.  
  432.      * Food
  433.      
  434.      This is the body,
  435.      which says something about the topic of food.
  436.      
  437.      ** Delicious Food
  438.      
  439.      This is the body of the second-level header.
  440.      
  441.      ** Distasteful Food
  442.      
  443.      This could have
  444.      a body too, with
  445.      several lines.
  446.      
  447.      *** Dormitory Food
  448.      
  449.      * Shelter
  450.      
  451.      A second first-level topic with its header line.
  452.  
  453.    A heading line together with all following body lines is called
  454. collectively an "entry".  A heading line together with all following
  455. deeper heading lines and their body lines is called a "subtree".
  456.  
  457.    You can customize the criterion for distinguishing heading lines by
  458. setting the variable `outline-regexp'.  Any line whose beginning has a
  459. match for this regexp is considered a heading line.  Matches that start
  460. within a line (not at the beginning) do not count.  The length of the
  461. matching text determines the level of the heading; longer matches make
  462. a more deeply nested level.  Thus, for example, if a text formatter has
  463. commands `@chapter', `@section' and `@subsection' to divide the
  464. document into chapters and sections, you can make those lines count as
  465. heading lines by setting `outline-regexp' to
  466. `"@chap\\|@\\(sub\\)*section"'.  Note the trick: the two words
  467. `chapter' and `section' are the same length, but by defining the regexp
  468. to match only `chap' we ensure that the length of the text matched on a
  469. chapter heading is shorter, so that Outline mode will know that
  470. sections are contained in chapters.  This works as long as no other
  471. command starts with `@chap'.
  472.  
  473.    Outline mode makes a line invisible by changing the newline before it
  474. into an ASCII Control-M (code 015).  Most editing commands that work on
  475. lines treat an invisible line as part of the previous line because,
  476. strictly speaking, it is part of that line, since there is no longer a
  477. newline in between.  When you save the file in Outline mode, Control-M
  478. characters are saved as newlines, so the invisible lines become ordinary
  479. lines in the file.  Saving does not change the visibility status of a
  480. line inside Emacs.
  481.  
  482. 
  483. File: xemacs.info,  Node: Outline Motion,  Next: Outline Visibility,  Prev: Outline Format,  Up: Outline Mode
  484.  
  485. Outline Motion Commands
  486. .......................
  487.  
  488.    Some special commands in Outline mode move backward and forward to
  489. heading lines.
  490.  
  491. `C-c C-n'
  492.      Move point to the next visible heading line
  493.      (`outline-next-visible-heading').
  494.  
  495. `C-c C-p'
  496.      Move point to the previous visible heading line
  497.      (`outline-previous-visible-heading').
  498.  
  499. `C-c C-f'
  500.      Move point to the next visible heading line at the same level as
  501.      the one point is on (`outline-forward-same-level').
  502.  
  503. `C-c C-b'
  504.      Move point to the previous visible heading line at the same level
  505.      (`outline-backward-same-level').
  506.  
  507. `C-c C-u'
  508.      Move point up to a lower-level (more inclusive) visible heading
  509.      line (`outline-up-heading').
  510.  
  511.    `C-c C-n' (`next-visible-heading') moves down to the next heading
  512. line.  `C-c C-p' (`previous-visible-heading') moves similarly backward.
  513. Both accept numeric arguments as repeat counts.  The names emphasize
  514. that invisible headings are skipped, but this is not really a special
  515. feature.  All editing commands that look for lines ignore the invisible
  516. lines automatically.
  517.  
  518.    More advanced motion commands understand the levels of headings.
  519. The commands `C-c C-f' (`outline-forward-same-level') and `C-c C-b'
  520. (`outline-backward-same-level') move from one heading line to another
  521. visible heading at the same depth in the outline.  `C-c C-u'
  522. (`outline-up-heading') moves backward to another heading that is less
  523. deeply nested.
  524.  
  525. 
  526. File: xemacs.info,  Node: Outline Visibility,  Prev: Outline Motion,  Up: Outline Mode
  527.  
  528. Outline Visibility Commands
  529. ...........................
  530.  
  531.    The other special commands of outline mode are used to make lines
  532. visible or invisible.  Their names all start with `hide' or `show'.
  533. Most of them exist as pairs of opposites.  They are not undoable;
  534. instead, you can undo right past them.  Making lines visible or
  535. invisible is simply not recorded by the undo mechanism.
  536.  
  537. `M-x hide-body'
  538.      Make all body lines in the buffer invisible.
  539.  
  540. `M-x show-all'
  541.      Make all lines in the buffer visible.
  542.  
  543. `C-c C-d'
  544.      Make everything under this heading invisible, not including this
  545.      heading itself (`hide-subtree').
  546.  
  547. `C-c C-s'
  548.      Make everything under this heading visible, including body,
  549.      subheadings, and their bodies (`show-subtree').
  550.  
  551. `M-x hide-leaves'
  552.      Make the body of this heading line, and of all its subheadings,
  553.      invisible.
  554.  
  555. `M-x show-branches'
  556.      Make all subheadings of this heading line, at all levels, visible.
  557.  
  558. `C-c C-i'
  559.      Make immediate subheadings (one level down) of this heading line
  560.      visible (`show-children').
  561.  
  562. `M-x hide-entry'
  563.      Make this heading line's body invisible.
  564.  
  565. `M-x show-entry'
  566.      Make this heading line's body visible.
  567.  
  568.    Two commands that are exact opposites are `M-x hide-entry' and `M-x
  569. show-entry'.  They are used with point on a heading line, and apply
  570. only to the body lines of that heading.  The subtopics and their bodies
  571. are not affected.
  572.  
  573.    Two more powerful opposites are `C-c C-h' (`hide-subtree') and `C-c
  574. C-s' (`show-subtree').  Both should be used when point is on a heading
  575. line, and both apply to all the lines of that heading's "subtree": its
  576. body, all its subheadings, both direct and indirect, and all of their
  577. bodies.  In other words, the subtree contains everything following this
  578. heading line, up to and not including the next heading of the same or
  579. higher rank.
  580.  
  581.    Intermediate between a visible subtree and an invisible one is having
  582. all the subheadings visible but none of the body.  There are two
  583. commands for doing this, one that hides the bodies and one that makes
  584. the subheadings visible.  They are `M-x hide-leaves' and `M-x
  585. show-branches'.
  586.  
  587.    A little weaker than `show-branches' is `C-c C-i' (`show-children').
  588. It makes just the direct subheadings visible--those one level down.
  589. Deeper subheadings remain invisible.
  590.  
  591.    Two commands have a blanket effect on the whole file.  `M-x
  592. hide-body' makes all body lines invisible, so that you see just the
  593. outline structure.  `M-x show-all' makes all lines visible.  You can
  594. think of these commands as a pair of opposites even though `M-x
  595. show-all' applies to more than just body lines.
  596.  
  597.    You can turn off the use of ellipses at the ends of visible lines by
  598. setting `selective-display-ellipses' to `nil'.  The result is no
  599. visible indication of the presence of invisible lines.
  600.  
  601. 
  602. File: xemacs.info,  Node: Words,  Next: Sentences,  Prev: Text Mode,  Up: Text
  603.  
  604. Words
  605. =====
  606.  
  607.    Emacs has commands for moving over or operating on words.  By
  608. convention, the keys for them are all `Meta-' characters.
  609.  
  610. `M-f'
  611.      Move forward over a word (`forward-word').
  612.  
  613. `M-b'
  614.      Move backward over a word (`backward-word').
  615.  
  616. `M-d'
  617.      Kill up to the end of a word (`kill-word').
  618.  
  619. `M-<DEL>'
  620.      Kill back to the beginning of a word (`backward-kill-word').
  621.  
  622. `M-@'
  623.      Mark the end of the next word (`mark-word').
  624.  
  625. `M-t'
  626.      Transpose two words;  drag a word forward or backward across other
  627.      words (`transpose-words').
  628.  
  629.    Notice how these keys form a series that parallels the
  630. character-based `C-f', `C-b', `C-d', `C-t' and <DEL>.  `M-@' is related
  631. to `C-@', which is an alias for `C-<SPC>'.
  632.  
  633.    The commands `Meta-f' (`forward-word') and `Meta-b'
  634. (`backward-word') move forward and backward over words.  They are
  635. analogous to `Control-f' and `Control-b', which move over single
  636. characters.  Like their `Control-' analogues, `Meta-f' and `Meta-b'
  637. move several words if given an argument.  `Meta-f' with a negative
  638. argument moves backward, and `Meta-b' with a negative argument moves
  639. forward.  Forward motion stops after the last letter of the word, while
  640. backward motion stops before the first letter.
  641.  
  642.    `Meta-d' (`kill-word') kills the word after point.  To be precise,
  643. it kills everything from point to the place `Meta-f' would move to.
  644. Thus, if point is in the middle of a word, `Meta-d' kills just the part
  645. after point.  If some punctuation comes between point and the next
  646. word, it is killed along with the word.  (To kill only the next word
  647. but not the punctuation before it, simply type `Meta-f' to get to the
  648. end and kill the word backwards with `Meta-<DEL>'.)  `Meta-d' takes
  649. arguments just like `Meta-f'.
  650.  
  651.    `Meta-<DEL>' (`backward-kill-word') kills the word before point.  It
  652. kills everything from point back to where `Meta-b' would move to.  If
  653. point is after the space in `FOO, BAR', then `FOO, ' is killed.   To
  654. kill just `FOO', type `Meta-b Meta-d' instead of `Meta-<DEL>'.
  655.  
  656.    `Meta-t' (`transpose-words') exchanges the word before or containing
  657. point with the following word.  The delimiter characters between the
  658. words do not move.  For example, transposing `FOO, BAR' results in
  659. `BAR, FOO' rather than `BAR FOO,'.  *Note Transpose::, for more on
  660. transposition and on arguments to transposition commands.
  661.  
  662.    To operate on the next N words with an operation which applies
  663. between point and mark, you can either set the mark at point and then
  664. move over the words, or you can use the command `Meta-@' (`mark-word')
  665. which does not move point but sets the mark where `Meta-f' would move
  666. to.  It can be given arguments just like `Meta-f'.
  667.  
  668.    The word commands' understanding of syntax is completely controlled
  669. by the syntax table.  For example, any character can be declared to be
  670. a word delimiter.  *Note Syntax::.
  671.  
  672. 
  673. File: xemacs.info,  Node: Sentences,  Next: Paragraphs,  Prev: Words,  Up: Text
  674.  
  675. Sentences
  676. =========
  677.  
  678.    The Emacs commands for manipulating sentences and paragraphs are
  679. mostly on `Meta-' keys, and therefore are like the word-handling
  680. commands.
  681.  
  682. `M-a'
  683.      Move back to the beginning of the sentence (`backward-sentence').
  684.  
  685. `M-e'
  686.      Move forward to the end of the sentence (`forward-sentence').
  687.  
  688. `M-k'
  689.      Kill forward to the end of the sentence (`kill-sentence').
  690.  
  691. `C-x <DEL>'
  692.      Kill back to the beginning of the sentence
  693.      (`backward-kill-sentence').
  694.  
  695.    The commands `Meta-a' and `Meta-e' (`backward-sentence' and
  696. `forward-sentence') move to the beginning and end of the current
  697. sentence, respectively.  They resemble `Control-a' and `Control-e',
  698. which move to the beginning and end of a line.  Unlike their
  699. counterparts, `Meta-a' and `Meta-e' move over successive sentences if
  700. repeated or given numeric arguments.  Emacs assumes the typist's
  701. convention is followed, and thus considers a sentence to end wherever
  702. there is a `.', `?', or `!' followed by the end of a line or two
  703. spaces, with any number of `)', `]', `'', or `"' characters allowed in
  704. between.  A sentence also begins or ends wherever a paragraph begins or
  705. ends.
  706.  
  707.    Neither `M-a' nor `M-e' moves past the newline or spaces beyond the
  708. sentence edge at which it is stopping.
  709.  
  710.    `M-a' and `M-e' have a corresponding kill command, just like `C-a'
  711. and `C-e' have `C-k'.  The command is  `M-k' (`kill-sentence') which
  712. kills from point to the end of the sentence.  With minus one as an
  713. argument it kills back to the beginning of the sentence.  Larger
  714. arguments serve as repeat counts.
  715.  
  716.    There is a special command, `C-x <DEL>' (`backward-kill-sentence'),
  717. for killing back to the beginning of a sentence, which is useful when
  718. you change your mind in the middle of composing text.
  719.  
  720.    The variable `sentence-end' controls recognition of the end of a
  721. sentence.  It is a regexp that matches the last few characters of a
  722. sentence, together with the whitespace following the sentence.  Its
  723. normal value is:
  724.  
  725.      "[.?!][]\"')]*\\($\\|\t\\|  \\)[ \t\n]*"
  726.  
  727. This example is explained in the section on regexps.  *Note Regexps::.
  728.  
  729. 
  730. File: xemacs.info,  Node: Paragraphs,  Next: Pages,  Prev: Sentences,  Up: Text
  731.  
  732. Paragraphs
  733. ==========
  734.  
  735.    The Emacs commands for manipulating paragraphs are also `Meta-' keys.
  736.  
  737. `M-['
  738.      Move back to previous paragraph beginning
  739.      (`backward-paragraph').
  740.  
  741. `M-]'
  742.      Move forward to next paragraph end (`forward-paragraph').
  743.  
  744. `M-h'
  745.      Put point and mark around this or next paragraph
  746.      (`mark-paragraph').
  747.  
  748.    `Meta-[' moves to the beginning of the current or previous paragraph,
  749. while `Meta-]' moves to the end of the current or next paragraph.
  750. Blank lines and text formatter command lines separate paragraphs and are
  751. not part of any paragraph.  An indented line starts a new paragraph.
  752.  
  753.    In major modes for programs (as opposed to Text mode), paragraphs
  754. begin and end only at blank lines.  As a result, the paragraph commands
  755. continue to be useful even though there are no paragraphs per se.
  756.  
  757.    When there is a fill prefix, paragraphs are delimited by all lines
  758. which don't start with the fill prefix.  *Note Filling::.
  759.  
  760.    To operate on a paragraph, you can use the command `Meta-h'
  761. (`mark-paragraph') to set the region around it.  This command puts
  762. point at the beginning and mark at the end of the paragraph point was
  763. in.  If point is between paragraphs (in a run of blank lines or at a
  764. boundary), the paragraph following point is surrounded by point and
  765. mark.  If there are blank lines preceding the first line of the
  766. paragraph, one of the blank lines is included in the region.  Thus, for
  767. example, `M-h C-w' kills the paragraph around or after point.
  768.  
  769.    The precise definition of a paragraph boundary is controlled by the
  770. variables `paragraph-separate' and `paragraph-start'.  The value of
  771. `paragraph-start' is a regexp that matches any line that either starts
  772. or separates paragraphs.  The value of `paragraph-separate' is another
  773. regexp that  matches only lines that separate paragraphs without being
  774. part of any paragraph.  Lines that start a new paragraph and are
  775. contained in it must match both regexps.  For example, normally
  776. `paragraph-start' is `"^[ \t\n\f]"' and `paragraph-separate' is `"^[
  777. \t\f]*$"'.
  778.  
  779.    Normally it is desirable for page boundaries to separate paragraphs.
  780. The default values of these variables recognize the usual separator for
  781. pages.
  782.  
  783. 
  784. File: xemacs.info,  Node: Pages,  Next: Filling,  Prev: Paragraphs,  Up: Text
  785.  
  786. Pages
  787. =====
  788.  
  789.    Files are often thought of as divided into "pages" by the "formfeed"
  790. character (ASCII Control-L, octal code 014).  For example, if a file is
  791. printed on a line printer, each "page" of the file starts on a new page
  792. of paper.  Emacs treats a page-separator character just like any other
  793. character.  It can be inserted with `C-q C-l' or deleted with <DEL>.
  794. You are free to paginate your file or not.  However, since pages are
  795. often meaningful divisions of the file, commands are provided to move
  796. over them and operate on them.
  797.  
  798. `C-x ['
  799.      Move point to previous page boundary (`backward-page').
  800.  
  801. `C-x ]'
  802.      Move point to next page boundary (`forward-page').
  803.  
  804. `C-x C-p'
  805.      Put point and mark around this page (or another page)
  806.      (`mark-page').
  807.  
  808. `C-x l'
  809.      Count the lines in this page (`count-lines-page').
  810.  
  811.    The `C-x [' (`backward-page') command moves point to immediately
  812. after the previous page delimiter.  If point is already right after a
  813. page delimiter, the command skips that one and stops at the previous
  814. one.  A numeric argument serves as a repeat count.  The `C-x ]'
  815. (`forward-page') command moves forward past the next page delimiter.
  816.  
  817.    The `C-x C-p' command (`mark-page') puts point at the beginning of
  818. the current page and the mark at the end.  The page delimiter at the end
  819. is included (the mark follows it).  The page delimiter at the front is
  820. excluded (point follows it).  You can follow this command  by `C-w' to
  821. kill a page you want to move elsewhere.  If you insert the page after a
  822. page delimiter, at a place where `C-x ]' or `C-x [' would take you, the
  823. page will be properly delimited before and after once again.
  824.  
  825.    A numeric argument to `C-x C-p' is used to specify which page to go
  826. to, relative to the current one.  Zero means the current page.  One
  827. means the next page, and -1 means the previous one.
  828.  
  829.    The `C-x l' command (`count-lines-page') can help you decide where
  830. to break a page in two.  It prints the total number of lines in the
  831. current page in the echo area, then divides the lines into those
  832. preceding the current line and those following it, for example
  833.  
  834.      Page has 96 (72+25) lines
  835.  
  836. Notice that the sum is off by one; this is correct if point is not at
  837. the beginning of a line.
  838.  
  839.    The variable `page-delimiter' should have as its value a regexp that
  840. matches the beginning of a line that separates pages.  This defines
  841. where pages begin.  The normal value of this variable is `"^\f"', which
  842. matches a formfeed character at the beginning of a line.
  843.  
  844. 
  845. File: xemacs.info,  Node: Filling,  Next: Case,  Prev: Pages,  Up: Text
  846.  
  847. Filling Text
  848. ============
  849.  
  850.    If you use Auto Fill mode, Emacs "fills" text (breaks it up into
  851. lines that fit in a specified width) as you insert it.  When you alter
  852. existing text it is often no longer be properly filled afterwards and
  853. you can use explicit commands for filling.
  854.  
  855. * Menu:
  856.  
  857. * Auto Fill::      Auto Fill mode breaks long lines automatically.
  858. * Fill Commands:: Commands to refill paragraphs and center lines.
  859. * Fill Prefix::   Filling when every line is indented or in a comment, etc.
  860.  
  861. 
  862. File: xemacs.info,  Node: Auto Fill,  Next: Fill Commands,  Prev: Filling,  Up: Filling
  863.  
  864. Auto Fill Mode
  865. --------------
  866.  
  867.    "Auto Fill" mode is a minor mode in which lines are broken
  868. automatically when they become too wide.  Breaking happens only when
  869. you type a <SPC> or <RET>.
  870.  
  871. `M-x auto-fill-mode'
  872.      Enable or disable Auto Fill mode.
  873.  
  874. `<SPC>'
  875. `<RET>'
  876.      In Auto Fill mode, break lines when appropriate.
  877.  
  878.    `M-x auto-fill-mode' turns Auto Fill mode on if it was off, or off
  879. if it was on.  With a positive numeric argument the command always turns
  880. Auto Fill mode on, and with a negative argument it always turns it off.
  881. The presence of the word `Fill' in the mode line, inside the
  882. parentheses, indicates that Auto Fill mode is in effect.  Auto Fill mode
  883. is a minor mode; you can turn it on or off for each buffer individually.
  884. *Note Minor Modes::.
  885.  
  886.    In Auto Fill mode, lines are broken automatically at spaces when
  887. they get longer than desired.  Line breaking and rearrangement takes
  888. place only when you type <SPC> or <RET>.  To insert a space or newline
  889. without permitting line-breaking, type `C-q <SPC>' or `C-q <LFD>'
  890. (recall that a newline is really a linefeed).  `C-o' inserts a newline
  891. without line breaking.
  892.  
  893.    Auto Fill mode works well with Lisp mode: when it makes a new line in
  894. Lisp mode, it indents that line with <TAB>.  If a line ending in a Lisp
  895. comment gets too long, the text of the comment is split into two
  896. comment lines.  Optionally, new comment delimiters are inserted at the
  897. end of the first line and the beginning of the second, so that each line
  898. is a separate comment.  The variable `comment-multi-line' controls the
  899. choice (*note Comments::.).
  900.  
  901.    Auto Fill mode does not refill entire paragraphs.  It can break
  902. lines but cannot merge lines.  Editing in the middle of a paragraph can
  903. result in a paragraph that is not correctly filled.  The easiest way to
  904. make the paragraph properly filled again is using an explicit fill
  905. commands.
  906.  
  907.    Many users like Auto Fill mode and want to use it in all text files.
  908. The section on init files explains how you can arrange this permanently
  909. for yourself.  *Note Init File::.
  910.  
  911. 
  912. File: xemacs.info,  Node: Fill Commands,  Next: Fill Prefix,  Prev: Auto Fill,  Up: Filling
  913.  
  914. Explicit Fill Commands
  915. ----------------------
  916.  
  917. `M-q'
  918.      Fill current paragraph (`fill-paragraph').
  919.  
  920. `M-g'
  921.      Fill each paragraph in the region (`fill-region').
  922.  
  923. `C-x f'
  924.      Set the fill column (`set-fill-column').
  925.  
  926. `M-x fill-region-as-paragraph'
  927.      Fill the region, considering it as one paragraph.
  928.  
  929. `M-s'
  930.      Center a line.
  931.  
  932.    To refill a paragraph, use the command `Meta-q' (`fill-paragraph').
  933. It causes the paragraph containing point, or the one after point if
  934. point is between paragraphs, to be refilled.  All line breaks are
  935. removed, and new ones are inserted where necessary.  `M-q' can be
  936. undone with `C-_'.  *Note Undo::.
  937.  
  938.    To refill many paragraphs, use `M-g' (`fill-region'), which divides
  939. the region into paragraphs and fills each of them.
  940.  
  941.    `Meta-q' and `Meta-g' use the same criteria as `Meta-h' for finding
  942. paragraph boundaries (*note Paragraphs::.).  For more control, you can
  943. use `M-x fill-region-as-paragraph', which refills everything between
  944. point and mark.  This command recognizes only blank lines as paragraph
  945. separators.
  946.  
  947.    A numeric argument to `M-g' or `M-q' causes it to "justify" the text
  948. as well as filling it.  Extra spaces are inserted to make the right
  949. margin line up exactly at the fill column.  To remove the extra spaces,
  950. use `M-q' or `M-g' with no argument.
  951.  
  952.    The variable `auto-fill-inhibit-regexp' takes as a value a regexp to
  953. match lines that should not be auto-filled.
  954.  
  955.    The command `Meta-s' (`center-line') centers the current line within
  956. the current fill column.  With an argument, it centers several lines
  957. individually and moves past them.
  958.  
  959.    The maximum line width for filling is in the variable `fill-column'.
  960. Altering the value of `fill-column' makes it local to the current
  961. buffer; until then, the default value--initially 70--is in effect.
  962. *Note Locals::.
  963.  
  964.    The easiest way to set `fill-column' is to use the command `C-x f'
  965. (`set-fill-column').  With no argument, it sets `fill-column' to the
  966. current horizontal position of point.  With a numeric argument, it uses
  967. that number as the new fill column.
  968.  
  969. 
  970. File: xemacs.info,  Node: Fill Prefix,  Prev: Fill Commands,  Up: Filling
  971.  
  972. The Fill Prefix
  973. ---------------
  974.  
  975.    To fill a paragraph in which each line starts with a special marker
  976. (which might be a few spaces, giving an indented paragraph), use the
  977. "fill prefix" feature.  The fill prefix is a string which is not
  978. included in filling.  Emacs expects every line to start with a fill
  979. prefix.
  980.  
  981. `C-x .'
  982.      Set the fill prefix (`set-fill-prefix').
  983.  
  984. `M-q'
  985.      Fill a paragraph using current fill prefix (`fill-paragraph').
  986.  
  987. `M-x fill-individual-paragraphs'
  988.      Fill the region, considering each change of indentation as
  989.      starting a new paragraph.
  990.  
  991.    To specify a fill prefix, move to a line that starts with the desired
  992. prefix, put point at the end of the prefix, and give the command
  993. `C-x .' (`set-fill-prefix').  That's a period after the `C-x'.  To turn
  994. off the fill prefix, specify an empty prefix: type `C-x .' with point
  995. at the beginning of a line.
  996.  
  997.    When a fill prefix is in effect, the fill commands remove the fill
  998. prefix from each line before filling and insert it on each line after
  999. filling.  Auto Fill mode also inserts the fill prefix inserted on new
  1000. lines it creates.  Lines that do not start with the fill prefix are
  1001. considered to start paragraphs, both in `M-q' and the paragraph
  1002. commands; this is just right if you are using paragraphs with hanging
  1003. indentation (every line indented except the first one).  Lines which are
  1004. blank or indented once the prefix is removed also separate or start
  1005. paragraphs; this is what you want if you are writing multi-paragraph
  1006. comments with a comment delimiter on each line.
  1007.  
  1008.    The fill prefix is stored in the variable `fill-prefix'.  Its value
  1009. is a string, or `nil' when there is no fill prefix.  This is a
  1010. per-buffer variable; altering the variable affects only the current
  1011. buffer, but there is a default value which you can change as well.
  1012. *Note Locals::.
  1013.  
  1014.    Another way to use fill prefixes is through `M-x
  1015. fill-individual-paragraphs'.  This function divides the region into
  1016. groups of consecutive lines with the same amount and kind of
  1017. indentation and fills each group as a paragraph, using its indentation
  1018. as a fill prefix.
  1019.  
  1020. 
  1021. File: xemacs.info,  Node: Case,  Prev: Filling,  Up: Text
  1022.  
  1023. Case Conversion Commands
  1024. ========================
  1025.  
  1026.    Emacs has commands for converting either a single word or any
  1027. arbitrary range of text to upper case or to lower case.
  1028.  
  1029. `M-l'
  1030.      Convert following word to lower case (`downcase-word').
  1031.  
  1032. `M-u'
  1033.      Convert following word to upper case (`upcase-word').
  1034.  
  1035. `M-c'
  1036.      Capitalize the following word (`capitalize-word').
  1037.  
  1038. `C-x C-l'
  1039.      Convert region to lower case (`downcase-region').
  1040.  
  1041. `C-x C-u'
  1042.      Convert region to upper case (`upcase-region').
  1043.  
  1044.    The word conversion commands are used most frequently.  `Meta-l'
  1045. (`downcase-word') converts the word after point to lower case, moving
  1046. past it.  Thus, repeating `Meta-l' converts successive words.  `Meta-u'
  1047. (`upcase-word') converts to all capitals instead, while `Meta-c'
  1048. (`capitalize-word') puts the first letter of the word into upper case
  1049. and the rest into lower case.  The word conversion commands convert
  1050. several words at once if given an argument.  They are especially
  1051. convenient for converting a large amount of text from all upper case to
  1052. mixed case: you can move through the text using `M-l', `M-u', or `M-c'
  1053. on each word as appropriate, occasionally using `M-f' instead to skip a
  1054. word.
  1055.  
  1056.    When given a negative argument, the word case conversion commands
  1057. apply to the appropriate number of words before point, but do not move
  1058. point.  This is convenient when you have just typed a word in the wrong
  1059. case: you can give the case conversion command and continue typing.
  1060.  
  1061.    If a word case conversion command is given in the middle of a word,
  1062. it applies only to the part of the word which follows point.  This is
  1063. just like what `Meta-d' (`kill-word') does.  With a negative argument,
  1064. case conversion applies only to the part of the word before point.
  1065.  
  1066.    The other case conversion commands are `C-x C-u' (`upcase-region')
  1067. and `C-x C-l' (`downcase-region'), which convert everything between
  1068. point and mark to the specified case.  Point and mark do not move.
  1069.  
  1070. 
  1071. File: xemacs.info,  Node: Programs,  Next: Running,  Prev: Text,  Up: Top
  1072.  
  1073. Editing Programs
  1074. ****************
  1075.  
  1076.    Emacs has many commands designed to understand the syntax of
  1077. programming languages such as Lisp and C.  These commands can:
  1078.  
  1079.    * Move over or kill balanced expressions or "sexps" (*note Lists::.).
  1080.  
  1081.    * Move over or mark top-level balanced expressions ("defuns", in
  1082.      Lisp; functions, in C).
  1083.  
  1084.    * Show how parentheses balance (*note Matching::.).
  1085.  
  1086.    * Insert, kill, or align comments (*note Comments::.).
  1087.  
  1088.    * Follow the usual indentation conventions of the language (*note
  1089.      Grinding::.).
  1090.  
  1091.    The commands available for words, sentences, and paragraphs are
  1092. useful in editing code even though their canonical application is for
  1093. editing human language text.  Most symbols contain words (*note
  1094. Words::.); sentences can be found in strings and comments (*note
  1095. Sentences::.).  Paragraphs per se are not present in code, but the
  1096. paragraph commands are useful anyway, because Lisp mode and C mode
  1097. define paragraphs to begin and end at blank lines (*note
  1098. Paragraphs::.).  Judicious use of blank lines to make the program
  1099. clearer also provides interesting chunks of text for the paragraph
  1100. commands to work on.
  1101.  
  1102.    The selective display feature is useful for looking at the overall
  1103. structure of a function (*note Selective Display::.).  This feature
  1104. causes only the lines that are indented less than a specified amount to
  1105. appear on the screen.
  1106.  
  1107. * Menu:
  1108.  
  1109. * Program Modes::       Major modes for editing programs.
  1110. * Lists::               Expressions with balanced parentheses.
  1111.                          There are editing commands to operate on them.
  1112. * Defuns::              Each program is made up of separate functions.
  1113.                          There are editing commands to operate on them.
  1114. * Grinding::            Adjusting indentation to show the nesting.
  1115. * Matching::            Insertion of a close-delimiter flashes matching open.
  1116. * Comments::            Inserting, illing and aligning comments.
  1117. * Balanced Editing::    Inserting two matching parentheses at once, etc.
  1118. * Lisp Completion::     Completion on symbol names in Lisp code.
  1119. * Documentation::       Getting documentation of functions you plan to call.
  1120. * Change Log::          Maintaining a change history for your program.
  1121. * Tags::                Go direct to any function in your program in one
  1122.                          command.  Tags remembers which file it is in.
  1123. * Fortran::        Fortran mode and its special features.
  1124. * Asm Mode::            Asm mode and its special features.
  1125.  
  1126. 
  1127. File: xemacs.info,  Node: Program Modes,  Next: Lists,  Prev: Programs,  Up: Programs
  1128.  
  1129. Major Modes for Programming Languages
  1130. =====================================
  1131.  
  1132.    Emacs has several major modes for the programming languages Lisp,
  1133. Scheme (a variant of Lisp), C, Fortran, and Muddle.  Ideally, a major
  1134. mode should be implemented for each programming language you might want
  1135. to edit with Emacs; but often the mode for one language can serve for
  1136. other syntactically similar languages.  The language modes that exist
  1137. are those that someone decided to take the trouble to write.
  1138.  
  1139.    There are several variants of Lisp mode, which differ in the way they
  1140. interface to Lisp execution.  *Note Lisp Modes::.
  1141.  
  1142.    Each of the programming language modes defines the <TAB> key to run
  1143. an indentation function that knows the indentation conventions of that
  1144. language and updates the current line's indentation accordingly.  For
  1145. example, in C mode <TAB> is bound to `c-indent-line'.  <LFD> is
  1146. normally defined to do <RET> followed by <TAB>; thus it, too, indents
  1147. in a mode-specific fashion.
  1148.  
  1149.    In most programming languages, indentation is likely to vary from
  1150. line to line.  So the major modes for those languages rebind <DEL> to
  1151. treat a tab as if it were the equivalent number of spaces (using the
  1152. command `backward-delete-char-untabify').  This makes it possible to
  1153. rub out indentation one column at a time without worrying whether it is
  1154. made up of spaces or tabs.  In these modes, use `C-b C-d' to delete a
  1155. tab character before point.
  1156.  
  1157.    Programming language modes define paragraphs to be separated only by
  1158. blank lines, so that the paragraph commands remain useful.  Auto Fill
  1159. mode, if enabled in a programming language major mode, indents the new
  1160. lines which it creates.
  1161.  
  1162.    Turning on a major mode calls a user-supplied function called the
  1163. "mode hook", which is the value of a Lisp variable.  For example,
  1164. turning on C mode calls the value of the variable `c-mode-hook' if that
  1165. value exists and is non-`nil'.  Mode hook variables for other
  1166. programming language modes include `lisp-mode-hook',
  1167. `emacs-lisp-mode-hook', `lisp-interaction-mode-hook',
  1168. `scheme-mode-hook', and `muddle-mode-hook'.  The mode hook function
  1169. receives no arguments.
  1170.  
  1171.